package com.wanxi.login.api;


import com.wanxi.login.domain.dto.LoginDefaultDto;
import com.wanxi.login.domain.dto.LoginDto;
import com.wanxi.login.domain.dto.LoginParamsDto;
import com.wanxi.login.domain.dto.PasswordDto;
import com.wanxi.login.domain.entity.TokenVo;
import com.wanxi.login.domain.result.LoginResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Author:Iny
 * @Data：2022/1/10 18:54
 */
@FeignClient(value = "login",path = "/back")
public interface LoginFeign {

    @ApiOperation(value = "登陆接口")
    @PostMapping("/login")
    LoginResult<TokenVo> login(@RequestBody LoginParamsDto loginParamsDto);

    @ApiOperation(value = "注册接口")
    @PostMapping("addLogin")
    LoginResult<Boolean> addLogin(@RequestBody LoginDto loginDto);

    @ApiOperation(value="通过用户id修改密码")
    @PutMapping("updatePasswordById")
    LoginResult<Boolean> updatePasswordByUserName(@RequestBody PasswordDto passwordDto);

    @ApiOperation(value="通过用户id修改状态")
    @PutMapping("updateDefaultById")
    LoginResult<Boolean> updateDefaultId(@RequestBody LoginDefaultDto loginDefaultDto);

    @ApiOperation(value="通过登陆id查找roleId")
    @GetMapping("findRoleIdById")
    LoginResult<Long> findRoleIdById(@RequestParam("id") Long id);
}
